<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

    <script src="vue1026.js"></script>

</head>
<body>
    <div id="app">
        <input type="text" name="" v-model="firstName" id="">
        <input type="text" name="" v-model="lastName" id="">
        {{fullName}}
    </div>
</body>

<script>
    new Vue({
        el:'#app',
        data:{
            firstName:'itcast',
            lastName:'heima',
            fullName:'heima.itcast',
        },
        //为变量添加 更变监控函数 1.0 版本  属性计算  属性操作
        watch:{
            'firstName':function(newval,oldval){
                this.fullName = newval + "--" + this.lastName;
            },
            'lastName':function(newval,oldval){
                this.fullName = this.firstName + "--" + newval;
            },
        }

    });

</script>
</html>